package com.example;

/**
 * @Auther: shiquan
 * @Date: 2024/10/13 - 10 - 13 -16:02
 */
public class Test3 {
    public static void main(String[] args) {
        //返回值方法的定义和调用形式
        getSum(1,2,3);
        //赋值调用
        int result=getSum(1,2,3);
        System.out.println("result = " + result);

        //输出调用
        System.out.println(getSum(1,2,3));

        //先计算第一个季度营业额
        int sum1 = getSum(100,200,300);
        //在计算第二个季度营业额
        int sum2 = getSum(400,500,600);
        //计算第三季度营业额
        int sum3 = getSum(700,800,900);
        //计算第四季度营业额
        int sum4 = getSum(1000,2000,3000);

        //计算总营业额
        int total = sum1+sum2+sum3+sum4;
        System.out.println("total = " + total);
    }
    public static int getSum(int a,int b,int c){
        int sum=a+b+c;
        return sum;//返回方法的结果
    }

}
